import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBNavigator.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBImageStyle/YBImageStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/yb_chinese_text/yb_chinese_text.dart';

class YBHomePageNewFourMainPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      height: YBTextStyle.adapterSize87,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: <Widget>[
          Container(
            child:InkWell(
              child: getMiShuType("kuai_zhangfang",YBChineseText.homeTextKuaiZhangFangTitle, YBChineseText.homeTextKuaiZhangFangSubTitle),
              onTap: () async {
                YBNavigatorUtil.jump(context, "/homePage/homePageDetailWebPage?webstr=${Uri.encodeComponent("http://cs.ubzone.cn?from=app")}");
              },
            ),
          ),
          Container(
            child:InkWell(
              child: getMiShuType("quan_guoguo",YBChineseText.homeTextQuanGuoGuoTitle, YBChineseText.homeTextQuanGuoGuoSubTitle),
              onTap: () async {
                YBNavigatorUtil.jump(context, "/homePage/homePageDetailWebPage?webstr=${Uri.encodeComponent("http://ipr.ubzone.cn?from=app")}");
              },
            ),
          ),
          Container(
            child:InkWell(
              child: getMiShuType("jinri_lvsi",YBChineseText.homeTextJinRiLvSiTitle, YBChineseText.homeTextJinRiLvSiSubTitle),
              onTap: () async {
                YBNavigatorUtil.jump(context, "/homePage/homePageDetailWebPage?webstr=${Uri.encodeComponent("http://law.ubzone.cn?from=app")}");
              },
            ),
          ),
        ],
      ),
    );
  }


  Widget getMiShuType(String imagStr,String titleStr,String subTitle){
    return Column(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        Container(
          height: YBTextStyle.adapterSize40,
          width: YBTextStyle.adapterSize40,
          child:SvgPicture.asset(YBImageStyle.getSVGPath(imagStr)),
        ),
        Container(
          child: Text(titleStr,style: YBTextStyle.homeSmallText,),
        ),
        Container(
          child: Text(subTitle,style: YBTextStyle.homeSmallSubText,),
        ),
      ],
    );
  }

}
